﻿CREATE TABLE [dbo].[ApplicationAttribute] (
    [ApplicationAttributeId]    INT          IDENTITY (1, 1) NOT NULL,
    [ApplicationId]    INT          NOT NULL,
    [Key]            VARCHAR (100) NOT NULL,
    [Value]          VARCHAR (150) NULL,
    CONSTRAINT [PK_ApplicationAttribute] PRIMARY KEY CLUSTERED ([ApplicationAttributeId] ASC),
    CONSTRAINT [FK_ApplicationAttribute] FOREIGN KEY ([ApplicationId]) REFERENCES [dbo].[Application] ([ApplicationId])
);



GO

CREATE INDEX [IX_EnterpriseAttribute_Key] ON [dbo].[EnterpriseAttribute] ([EnterpriseId], [Key])

GO

CREATE UNIQUE INDEX [IX_ApplicationAttribute_IdKey] ON [dbo].[ApplicationAttribute] ([ApplicationId], [Key])
